import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// 引入插件(图片懒加载)
import VueLazyload from 'vue-lazyload'

// 引入element组件
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);
// 引入重置样式
import '@/assets/style/reset.css'
// 引入iconfont样式
import '@/assets/style/iconfont.css'

// 注册全局组件
import HeaderNav from '@/components/headerNav'
Vue.component(HeaderNav.name, HeaderNav)

// 引入全部api接口
import * as API from '@/api/index'

// 配置懒加载默认图片
const loading = require('./assets/qq.jpg')
Vue.use(VueLazyload, {
  loading,
  dispatchEvent: true
})

new Vue({
  // 全局事件总线$bus的配置
  beforeCreate() {
    Vue.prototype.$bus = this
    Vue.prototype.$API = API
  },
  router,
  store,
  render: h => h(App)
}).$mount('#app')
